package org.logistics;

import android.content.Context;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;

public class MapKeyPermission {
	
	public MapKeyPermission()
	{
	}
	/**
	 * 判断网络状态
	 * @param context
	 * @return
	 */
	public boolean checkNetError(Context context) {
        try {
                NetworkInfo networkInfo = null;

                ConnectivityManager nw = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
                networkInfo = nw.getActiveNetworkInfo();

                return networkInfo.isAvailable();// 网络是否可用
        } catch (Exception e) {
                // TODO: handle exception
                return false;
        }

}

}
